package com.example.controller.carecommunity.homebasedcare;

import com.example.bean.carecommunity.SheQujujia;
import com.example.bean.carecommunity.Vo.RiZhaoVO;
import com.example.service.carecommunity.homebasedcare.JujiayanglaoService;
import com.example.utils.Results;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/jujiayanglao")
@Api(tags = "居家养老服务控制器")
public class JujiayanglaoController {
    @Autowired
    JujiayanglaoService service;

    @PostMapping("/selectjjyl")
    @ApiOperation(value = "查询所有",notes = "日照服务查询")
    public Results selectRijianzhailiao(@RequestBody RiZhaoVO riZhaoVO){
        PageInfo<SheQujujia> page = service.selectJujiayanglaoAll(riZhaoVO);
        return new Results().data("page",page);
    }

    @PostMapping("/addjujia")
    public Results addjujia(@RequestBody SheQujujia rijianzhaoliao){
        return new Results().code(service.addjujia(rijianzhaoliao));
    }
}